import {Pipe, PipeTransform} from '@angular/core';
import * as moment from 'moment';

@Pipe({name: 'dateFormat'})
export class DateFormatPipe implements PipeTransform {
  transform(value: string, pattern: string = 'YYYY/MM/DD HH:mm:ss',): string {
    if (!value) {
      return '';
    }
    return moment(value).format(pattern);
  }
}
